<% 
my = nil
if session['user']
  my = (opinion.user_id == session['user'].get_user['id'].to_i)
end
%>

<div class="comment <%=my ? 'my':''%>">

<div id="user"><%= opinion.user.name %></div>
<% if opinion.rating == 0 %>
Pas de note
<% else %>
<b>Note</b>: <%=opinion.rating%> / 10
<% end %>

<% if my %>
<%= link_to_remote('Editer', {:url=>{:controller=>'movie',:action=>'edit_comment', :id=>opinion}, :update=>'entry'}, {:class=>'btnlnk'}) %>
<% end %>

<br/>
<%=opinion.comment.gsub(/\n/, '<br/>')%>
(<%= time_ago_in_words(opinion.created_at)%> ago)<br/>

</div>
